Skip to content

[tmva][sofie] Improvements to SOFIE Keras parser on the Python side#22381

Merged
guitargeek merged 2 commits into
root-project:masterfrom
guitargeek:tmva-sofie-pyz
May 24, 2026
Merged

[tmva][sofie] Improvements to SOFIE Keras parser on the Python side#22381
guitargeek merged 2 commits into
root-project:masterfrom
guitargeek:tmva-sofie-pyz

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

@guitargeek guitargeek commented May 22, 2026

Some improvements to the SOFIE Keras parser on the Python side, inspired by the cppyy upgrade work.

This also fixes a logic error where a binary operator with any name was falling back to multiplication.

@guitargeek guitargeek self-assigned this May 22, 2026
@guitargeek guitargeek force-pushed the tmva-sofie-pyz branch 2 times, most recently from e342e8a to 77629bd Compare May 22, 2026 06:59
Re-implement the binary operator creation in the Keras parser code path
in C++, so the Python side Keras parser implementation doesn't have to
deal with SOFIE implementation details like the `EBasicBinaryOperator`
or which binary operator types are supported.

This also fixes a logic error where a binary operator with any name was
falling back to multiplication.
This makes the overload that takes memory by raw pointer more consistent
with the other overload that takes a `std::shared_ptr<void>`.

This avoids also the need for some template instantiations on the SOFIE
Pythonizations side, saving some memory cost.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 23, 2026

Test Results

    22 files      22 suites   3d 14h 32m 38s ⏱️
 3 856 tests  3 855 ✅ 0 💤 1 ❌
77 039 runs  77 038 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 0685a1f.

♻️ This comment has been updated with latest results.

@guitargeek guitargeek requested a review from aaronj0 May 24, 2026 09:07
Copy link
Copy Markdown
Contributor

@aaronj0 aaronj0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with SOFIE, but these look like good improvements to me from a pythonization standpoint. This makes the usage of cppyy more sane, by no longer relying on wrapper generation for template types that can resolve to ndarray.

For MakeKerasBinary, it is also good that we moved the logic to C++

@guitargeek guitargeek merged commit 9a7f3e7 into root-project:master May 24, 2026
77 of 83 checks passed
@guitargeek guitargeek deleted the tmva-sofie-pyz branch May 24, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants